package com.example.vueserver.vueserver.dao;

import com.example.vueserver.vueserver.bean.SysUserRole;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface SysUserRoleMapper {
    @Select("SELECT * FROM sys_user_role WHERE user_id = #{userId}")
    List<SysUserRole> listByUserId(Integer userId);

    @Insert("insert into sys_user_role(user_id,role_id) values(#{userId},#{roleId})")
    void saveSysUserRole(SysUserRole sysUserRole);

    @Select("select * from sys_user_role")
    List<SysUserRole> listAll();

    @Delete("delete from sys_user_role where user_id = #{userId}")
    void deleteByUserId(Integer userId);
}

